/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package VIEW;

import java.awt.CardLayout;

/**
 *
 * @author Belthazod
 */
public class AdminUI extends javax.swing.JPanel {
    CardLayout card; 
    /**
     * Creates new form Admin
     */
    public AdminUI() {
        initComponents();
        card = (CardLayout)adminCards.getLayout();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        supplierAdminButton = new javax.swing.JButton();
        productAdminButton = new javax.swing.JButton();
        backupAdminButton = new javax.swing.JButton();
        userAdminButton = new javax.swing.JButton();
        adjustmentButton = new javax.swing.JButton();
        secondhandButton = new javax.swing.JButton();
        categoryButton = new javax.swing.JButton();
        adminCards = new javax.swing.JPanel();
        adjustmentsNew1 = new VIEW.AdjustmentsNew();
        adjustmentPanel = new VIEW.AdjustmentsUI();
        secondhand1 = new VIEW.Secondhand();
        productsPanel = new VIEW.ProductsUI();
        supplierPanel = new VIEW.SupplierUI();
        backUpPanel = new VIEW.BackUp();
        userPanel = new VIEW.UserUI();
        category1 = new VIEW.Category();
        jLabel1 = new javax.swing.JLabel();

        setBackground(new java.awt.Color(153, 153, 153));
        setForeground(new java.awt.Color(255, 255, 255));
        setToolTipText("");

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));

        supplierAdminButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        supplierAdminButton.setText("Supplier");
        supplierAdminButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                supplierAdminButtonActionPerformed(evt);
            }
        });

        productAdminButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        productAdminButton.setText("Product");
        productAdminButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                productAdminButtonActionPerformed(evt);
            }
        });

        backupAdminButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        backupAdminButton.setText("Back Up");
        backupAdminButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backupAdminButtonActionPerformed(evt);
            }
        });

        userAdminButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        userAdminButton.setText("User");
        userAdminButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                userAdminButtonActionPerformed(evt);
            }
        });

        adjustmentButton.setText("Adjustments");
        adjustmentButton.setEnabled(false);
        adjustmentButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                adjustmentButtonActionPerformed(evt);
            }
        });

        secondhandButton.setText("Secondhand");
        secondhandButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                secondhandButtonActionPerformed(evt);
            }
        });

        categoryButton.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        categoryButton.setText("Category");
        categoryButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                categoryButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(24, 24, 24)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(secondhandButton)
                    .addComponent(supplierAdminButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(productAdminButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(backupAdminButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(userAdminButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(adjustmentButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(categoryButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addComponent(adjustmentButton)
                .addGap(18, 18, 18)
                .addComponent(productAdminButton)
                .addGap(15, 15, 15)
                .addComponent(secondhandButton)
                .addGap(18, 18, 18)
                .addComponent(supplierAdminButton)
                .addGap(13, 13, 13)
                .addComponent(categoryButton)
                .addGap(18, 18, 18)
                .addComponent(userAdminButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(backupAdminButton)
                .addContainerGap(31, Short.MAX_VALUE))
        );

        adminCards.setLayout(new java.awt.CardLayout());
        adminCards.add(adjustmentsNew1, "adjustmentNewCard");
        adminCards.add(adjustmentPanel, "adjustmentCard");
        adminCards.add(secondhand1, "secondhandCard");
        adminCards.add(productsPanel, "productCard");
        adminCards.add(supplierPanel, "supplierCard");
        adminCards.add(backUpPanel, "backupCard");
        adminCards.add(userPanel, "userCard");
        adminCards.add(category1, "categoryCard");

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jLabel1.setText("Admin Panel");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(adminCards, javax.swing.GroupLayout.PREFERRED_SIZE, 870, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 145, Short.MAX_VALUE))
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(adminCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
    }// </editor-fold>//GEN-END:initComponents

    private void productAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productAdminButtonActionPerformed

        card.show(adminCards, "productCard");
        
        userAdminButton.setEnabled(true);
        secondhandButton.setEnabled(true);
         categoryButton.setEnabled(true);
        productAdminButton.setEnabled(false);
        supplierAdminButton.setEnabled(true);
        backupAdminButton.setEnabled(true);
        adjustmentButton.setEnabled(true);
    }//GEN-LAST:event_productAdminButtonActionPerformed

    private void supplierAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_supplierAdminButtonActionPerformed

        card.show(adminCards, "supplierCard");
        
        userAdminButton.setEnabled(true);
        secondhandButton.setEnabled(true);
         categoryButton.setEnabled(true);
        productAdminButton.setEnabled(true);
        supplierAdminButton.setEnabled(false);
        backupAdminButton.setEnabled(true);
        adjustmentButton.setEnabled(true);
    }//GEN-LAST:event_supplierAdminButtonActionPerformed

    private void backupAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backupAdminButtonActionPerformed

        card.show(adminCards, "backupCard");
        
        userAdminButton.setEnabled(true);
        secondhandButton.setEnabled(true);
         categoryButton.setEnabled(true);
        backupAdminButton.setEnabled(false);
        productAdminButton.setEnabled(true);
        supplierAdminButton.setEnabled(true);
        adjustmentButton.setEnabled(true);
    }//GEN-LAST:event_backupAdminButtonActionPerformed

    private void userAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_userAdminButtonActionPerformed
        card.show(adminCards, "userCard");
        
        userAdminButton.setEnabled(false);
        backupAdminButton.setEnabled(true);
         categoryButton.setEnabled(true);
        productAdminButton.setEnabled(true);
        supplierAdminButton.setEnabled(true);
        adjustmentButton.setEnabled(true);
    }//GEN-LAST:event_userAdminButtonActionPerformed

    private void adjustmentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_adjustmentButtonActionPerformed
        card.show(adminCards, "adjustmentNewCard");
        
        adjustmentButton.setEnabled(false);
        secondhandButton.setEnabled(true);
        userAdminButton.setEnabled(true);
         categoryButton.setEnabled(true);
        backupAdminButton.setEnabled(true);
        productAdminButton.setEnabled(true);
        supplierAdminButton.setEnabled(true);
    }//GEN-LAST:event_adjustmentButtonActionPerformed

    private void secondhandButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_secondhandButtonActionPerformed
        card.show(adminCards, "secondhandCard");
        
        userAdminButton.setEnabled(true);
        secondhandButton.setEnabled(false);
         categoryButton.setEnabled(true);
        productAdminButton.setEnabled(true);
        supplierAdminButton.setEnabled(true);
        backupAdminButton.setEnabled(true);
        adjustmentButton.setEnabled(true);
    }//GEN-LAST:event_secondhandButtonActionPerformed

    private void categoryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_categoryButtonActionPerformed
        
        card.show(adminCards, "categoryCard");
        userAdminButton.setEnabled(true);
        secondhandButton.setEnabled(true);
        categoryButton.setEnabled(false);
        productAdminButton.setEnabled(true);
        supplierAdminButton.setEnabled(true);
        backupAdminButton.setEnabled(true);
        adjustmentButton.setEnabled(true);// TODO add your handling code here:
    }//GEN-LAST:event_categoryButtonActionPerformed

    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton adjustmentButton;
    private VIEW.AdjustmentsUI adjustmentPanel;
    private VIEW.AdjustmentsNew adjustmentsNew1;
    private javax.swing.JPanel adminCards;
    private VIEW.BackUp backUpPanel;
    private javax.swing.JButton backupAdminButton;
    private VIEW.Category category1;
    private javax.swing.JButton categoryButton;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JButton productAdminButton;
    private VIEW.ProductsUI productsPanel;
    private VIEW.Secondhand secondhand1;
    private javax.swing.JButton secondhandButton;
    private javax.swing.JButton supplierAdminButton;
    private VIEW.SupplierUI supplierPanel;
    private javax.swing.JButton userAdminButton;
    private VIEW.UserUI userPanel;
    // End of variables declaration//GEN-END:variables
}
